package com.kaigejava.juc.toolsdemo.countdowlatchdemo;

/**
 * @author kaigejava
 * 模拟火箭发射-未使用countdownlatch演示代码
 *
 */
public class RocketLaunchingDemo1 {
    public static void main(String[] args) {
        //参与部门数量
        int departmentSize = 5;
        int count = departmentSize;
        for(int i = 0;i<departmentSize ;i++){
            RocketDepartmentThread rocketDepartmentThread = new RocketDepartmentThread(""+(i+1));
            Thread thread = new Thread(rocketDepartmentThread);
            thread.start();
            count--;
        }
        if(count==0){
            System.out.println("==总控室以收到。准备发射~~~");
            System.out.println("====发射====");
        }

    }
}
